#!/bin/bash

for file in `tree -if --noreport | egrep "\.(patch|patch1|diff)$"`; do
    echo Apply $file
    patch -p1 < $file > /dev/null
    if [ $? != 0 ]; then
        echo "Failed"
        exit 1
    fi
done
echo "Done"
